<script setup lang="ts">
import { ref, watch } from 'vue'
const count = ref(0)
const name = ref('韩璐')
const change = () => {
  count.value++
}
// 监听一个
watch(count, (oldValue, newValue) => {
  console.log(oldValue, newValue)
})
// 监听多个
watch([count, name], (oldValue, newValue) => {
  console.log(oldValue, newValue)
})
</script>

<template>
  <div class="app-page">
    <div>{{ count }}</div>
    <button @click="change">按钮</button>
  </div>
</template>

<style lang="css" scoped></style>
